<!DOCTYPE html>
<html lang="zh-CN">





<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/blog/img/apple-touch-icon.png">
  <link rel="icon" type="image/png" href="/blog/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="兴趣使然的个人博客">
  <meta name="author" content="Ilirus">
  <meta name="keywords" content>
  <title>Ilirus</title>

  <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/css/bootstrap.min.css">



<!-- 主题依赖的图标库，不要自行修改 -->
<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_yg9cfy8wd6.css">

<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_pjno9b9zyxs.css">

<link rel="stylesheet" href="/blog/css/main.css">

<!-- 自定义样式保持在最底部 -->


  <script src="/blog/js/utils.js"></script>
</head>


<body>
  <header style="height: 100vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/blog/">&nbsp;<strong>Ilirus</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" data-toggle="modal" data-target="#modalSearch">&nbsp;&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="view intro-2" id="background" parallax=true
         style="background: url('/blog/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="container text-center white-text fadeInUp">
            <span class="h2" id="subtitle">
              
            </span>

            
          </div>

          
            <div class="scroll-down-bar">
              <i class="iconfont icon-arrowdown"></i>
            </div>
          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      <div class="container nopadding-md">
        <div class="py-5" id="board"
          style=margin-top:0>
          
          <div class="container">
            <div class="row">
              <div class="col-12 col-md-10 m-auto">
                


  <div class="row mx-auto index-card">
    
    
    <div class="col-12 col-md-12 mx-auto index-info">
      <a class="index-header" href="/blog/2021/05/21/Minecraft-Mod开发手册01-第一个物品/">Minecraft Mod 开发手册01: 第一个物品</a>

      <a href="/blog/2021/05/21/Minecraft-Mod开发手册01-第一个物品/" class="index-excerpt">
        
        
          
        
        <div>向Minecraft中添加物品定位入口找到fabric.mod.json 文件中entrypoints.main 键所对应的类&#123;
  // ...
  "entrypoints": &#123;
    "main": [
      "com.ilirus.widget.pack.WidgetPackKt::init"
    ]
  &#125;,
  // ...
&#125;
我</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2021-05-21
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/学习笔记/">学习笔记</a>
            
              <a href="/blog/categories/学习笔记/Fabric/">Fabric</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Minecraft/">Minecraft</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
    <div class="col-12 col-md-12 mx-auto index-info">
      <a class="index-header" href="/blog/2021/05/20/Minecraft-Mod开发手册00-开发环境搭建/">Minecraft Mod 开发手册00: 开发环境搭建</a>

      <a href="/blog/2021/05/20/Minecraft-Mod开发手册00-开发环境搭建/" class="index-excerpt">
        
        
          
        
        <div>Fabric开发环境搭建Minecraft目前有Forge和Fabric两大Mod平台，这里我选择使用较新的Fabric平台。
开发工具
jdk8以上
任意IDE

创建项目
下载Fabric官方的项目初始模板，Kotlin开发人员可以下载Kotlin版
修改gradle.properties 文件
修改maven_group 为你的组织名(类似于Maven中的GroupId)
修改archive</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2021-05-20
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/学习笔记/">学习笔记</a>
            
              <a href="/blog/categories/学习笔记/Fabric/">Fabric</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Minecraft/">Minecraft</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/blog/2021/01/10/使用ControllerAdvice统一封装Controller返回数据/" target="_self">
          <img src="/blog/img/202012/title.jpg" srcset="/blog/img/loading.gif" alt="使用ControllerAdvice统一封装Controller返回数据">
        </a>
      </div>
    
    <div class="col-12 col-md-8 mx-auto index-info">
      <a class="index-header" href="/blog/2021/01/10/使用ControllerAdvice统一封装Controller返回数据/">使用ControllerAdvice统一封装Controller返回数据</a>

      <a href="/blog/2021/01/10/使用ControllerAdvice统一封装Controller返回数据/" class="index-excerpt">
        
        
          
        
        <div>在给前端提供Api接口时，通常会约定好一个统一返回格式，这样方便前端处理返回结果
@RestController
@RequestMapping("/index")
public class IndexController &#123;

  @GetMapping
  public R&lt;Data&gt; index() &#123;
    return R.ofSuccess(new D</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2021-01-10
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/Java/">Java</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
              <a href="/blog/tags/SpringBoot/">SpringBoot</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/blog/2020/11/18/Validate自定义校验注解/" target="_self">
          <img src="/blog/img/202011/title.jpg" srcset="/blog/img/loading.gif" alt="Validate自定义校验注解">
        </a>
      </div>
    
    <div class="col-12 col-md-8 mx-auto index-info">
      <a class="index-header" href="/blog/2020/11/18/Validate自定义校验注解/">Validate自定义校验注解</a>

      <a href="/blog/2020/11/18/Validate自定义校验注解/" class="index-excerpt">
        
        
          
        
        <div>自定义Validator校验注解通常来说, Hibernate Validation提供的注解已经够用了, 但有时候还是需要根据业务自定义校验规则.
自定义注解@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(&#123;
  ElementType.METHOD,
  ElementType.FIELD,
  ElementType.</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-11-18
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/Java/">Java</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/blog/2020/11/10/Validate参数分组校验/" target="_self">
          <img src="/blog/img/202011/title.jpg" srcset="/blog/img/loading.gif" alt="Validate参数分组校验">
        </a>
      </div>
    
    <div class="col-12 col-md-8 mx-auto index-info">
      <a class="index-header" href="/blog/2020/11/10/Validate参数分组校验/">Validate参数分组校验</a>

      <a href="/blog/2020/11/10/Validate参数分组校验/" class="index-excerpt">
        
        
          
        
        <div>Validator分组校验定义接口, 接口里面不需要写任何东西, Validator会把接口视为一个一个的组public interface IGet &#123;&#125;

public interface IList &#123;&#125;

public interface IAdd &#123;&#125;

public interface IEdit &#123;&#125;

</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-11-10
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/Java/">Java</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/blog/2020/11/08/Validate参数统一校验/" target="_self">
          <img src="/blog/img/202011/title.jpg" srcset="/blog/img/loading.gif" alt="使用Validate实现参数统一校验以及自定义校验规则">
        </a>
      </div>
    
    <div class="col-12 col-md-8 mx-auto index-info">
      <a class="index-header" href="/blog/2020/11/08/Validate参数统一校验/">使用Validate实现参数统一校验以及自定义校验规则</a>

      <a href="/blog/2020/11/08/Validate参数统一校验/" class="index-excerpt">
        
        
          
        
        <div>
JSR-303是一项标准, JSR-349是其的升级版本, 添加了一些新特性, 这项标准规定了一些校验规范, 如@Null, @NotNull, @Pattern, 位于javax.validation.constraints包下, 只提供规范不提供实现.Hibernate Validation是对这个规范的实践, 他提供了相应的实现, 并增加了一些其他校验注解, 如@Email, @Lengt</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-11-08
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/Java/">Java</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/blog/2020/10/19/使用自定义断言处理常见的异常/" target="_self">
          <img src="/blog/img/20201019/title.jpg" srcset="/blog/img/loading.gif" alt="使用自定义断言处理常见的异常">
        </a>
      </div>
    
    <div class="col-12 col-md-8 mx-auto index-info">
      <a class="index-header" href="/blog/2020/10/19/使用自定义断言处理常见的异常/">使用自定义断言处理常见的异常</a>

      <a href="/blog/2020/10/19/使用自定义断言处理常见的异常/" class="index-excerpt">
        
        
          
        
        <div>　　Java中空判断随处可见，通常我们都是手动判断是否为空，然后再抛出自定义异常以及记录信息，例如:var data = dao.findById(id);
if(data == null) &#123;
  log.error("数据为空, id&#123;&#125;", id);
  throw new CustomException(Status.USER_NOT_EXIST);
&#12</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-10-19
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/Java/">Java</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/blog/2020/04/20/Java是值传递还是引用传递/" target="_self">
          <img src="/blog/img/20200420-23/ref.png" srcset="/blog/img/loading.gif" alt="Java是值传递还是引用传递">
        </a>
      </div>
    
    <div class="col-12 col-md-8 mx-auto index-info">
      <a class="index-header" href="/blog/2020/04/20/Java是值传递还是引用传递/">Java是值传递还是引用传递</a>

      <a href="/blog/2020/04/20/Java是值传递还是引用传递/" class="index-excerpt">
        
        
          
        
        <div>进入正题之前先简单说说值传递和引用传递的区别

按值调用(call by value)表示方法接收的是调用者提供的值，而按引用调用(call by reference)表示方法接收的是调用者提供的变量地址。一个方法可以修改传递引用所对应的变量值，而不能修改传递值调用所对应的变量值。

下面是我用Rust来做的一个简单示范。

可以看到，虽然call_by_value函数和call_by_refer</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-04-20
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/Java/">Java</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
    <div class="col-12 col-md-12 mx-auto index-info">
      <a class="index-header" href="/blog/2020/04/18/Java8中新增的时间处理API/">Java8中新增的时间处理API</a>

      <a href="/blog/2020/04/18/Java8中新增的时间处理API/" class="index-excerpt">
        
        
          
        
        <div>Java8新的时间处理API原有的java.util.Date与新增的java.time有何差异？

java.util.Date设定为可变类型
SimpleDateFormat是非线程安全的
新的API 基于ISO 标准日历系统, 遵循Gregorian 规则
java.time包下的所有类都是不可变类型
java.time包下的所有类都是线程安全的

java.time简单介绍java.tim</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-04-18
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/Java/">Java</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
    <div class="col-12 col-md-12 mx-auto index-info">
      <a class="index-header" href="/blog/2020/04/11/OAuth2-0资源服务器搭建与配置/">OAuth2.0资源服务器搭建与配置</a>

      <a href="/blog/2020/04/11/OAuth2-0资源服务器搭建与配置/" class="index-excerpt">
        
        
          
        
        <div>OAuth2.0资源服务器搭建引入依赖&lt;dependency&gt;
  &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
  &lt;artifactId&gt;spring-cloud-starter-security&lt;/artifactId&gt;
&lt;/dependency&gt;
&lt;dependency</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-04-11
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/OAuth/">OAuth</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/OAuth/">OAuth</a>
            
          </div>
        
      </div>
    </div>
  </div>



  <nav aria-label="navigation">
    <span class="pagination" id="pagination">
      <span class="page-number current">1</span><a class="page-number" href="/blog/page/2/">2</a><a class="page-number" href="/blog/page/3/">3</a><span class="space">&hellip;</span><a class="page-number" href="/blog/page/6/">6</a><a class="extend next" rel="next" href="/blog/page/2/"><i class="iconfont icon-arrowright"></i></a>
    </span>
  </nav>
  
  <script>
    for (ele of document.getElementById("pagination").getElementsByTagName("a")) {
      ele.href += '#board';
    }
  </script>



              </div>
            </div>
          </div>
        </div>
      </div>
    
  </main>

  
    <a id="scroll-top-button" href="#" role="button">
      <i class="iconfont icon-arrowup" aria-hidden="true"></i>
    </a>
  

  
    <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
  

  

  

  <footer class="mt-5">
  <div class="text-center py-3">
    <div>
      <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a>
      <i class="iconfont icon-love"></i>
      <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener">
        <span>Fluid</span></a>
    </div>
    

    

    
  </div>
</footer>

<!-- SCRIPTS -->
<script  src="https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js" ></script>
<script  src="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/js/bootstrap.min.js" ></script>
<script  src="/blog/js/debouncer.js" ></script>
<script  src="/blog/js/main.js" ></script>

<!-- Plugins -->


  
    <script  src="/blog/js/lazyload.js" ></script>
  



  <script defer src="https://cdn.staticfile.org/clipboard.js/2.0.6/clipboard.min.js" ></script>
  <script  src="/blog/js/clipboard-use.js" ></script>









  <script  src="https://cdn.staticfile.org/typed.js/2.0.11/typed.min.js" ></script>
  <script>
    var typed = new Typed('#subtitle', {
      strings: [
        '  ',
        "一个兴趣使然的个人博客&nbsp;",
      ],
      cursorChar: "_",
      typeSpeed: 70,
      loop: false,
    });
    typed.stop();
    $(document).ready(function () {
      $(".typed-cursor").addClass("h2");
      typed.start();
    });
  </script>





  <script  src="/blog/js/local-search.js" ></script>
  <script>
    var path = "/blog/local-search.xml";
    var inputArea = document.querySelector("#local-search-input");
    inputArea.onclick = function () {
      searchFunc(path, 'local-search-input', 'local-search-result');
      this.onclick = null
    }
  </script>









  
  
    <script type="text/javascript">
      //定义获取词语下标
      var a_idx = 0;
      jQuery(document).ready(function ($) {
        //点击body时触发事件
        $("body").click(function (e) {
          //需要显示的词语
          var a = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善");
          //设置词语给span标签
          var $i = $("<span/>").text(a[a_idx]);
          //下标等于原来下标+1  余 词语总数
          a_idx = (a_idx + 1) % a.length;
          //获取鼠标指针的位置，分别相对于文档的左和右边缘。
          //获取x和y的指针坐标
          var x = e.pageX, y = e.pageY;
          //在鼠标的指针的位置给$i定义的span标签添加css样式
          $i.css({
            "z-index": 999,
            "top": y - 20,
            "left": x,
            "position": "absolute",
            "font-weight": "bold",
            "color": rand_color()
          });
          // 随机颜色
          function rand_color() {
            return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"
          }
          //在body添加这个标签
          $("body").append($i);
          //animate() 方法执行 CSS 属性集的自定义动画。
          //该方法通过CSS样式将元素从一个状态改变为另一个状态。CSS属性值是逐渐改变的，这样就可以创建动画效果。
          //详情请看http://www.w3school.com.cn/jquery/effect_animate.asp
          $i.animate({
            //将原来的位置向上移动180
            "top": y - 180,
            "opacity": 0
            //1500动画的速度
          }, 1500, function () {
            //时间到了自动删除
            $i.remove();
          });
        });
      })
      ;
    </script>
  














<script src="/blog/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginModelPath":"assets/","model":{"jsonPath":"/blog/live2dw/assets/tororo.model.json"},"display":{"position":"left","width":300,"height":300},"mobile":{"show":false},"log":false,"pluginJsPath":"lib/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
